#pragma once

#include <algorithm/analytical_model/algorithm/cuda/inter_op/Data.h>
#include <algorithm/analytical_model/algorithm/cuda/inter_op/utils/executor/AsyncFunctionExecutor.h>

#include <thrust/system/cuda/future.h>

namespace solar::cuda::async
{
    struct MetricsRADArgs : FunctionArgs
    {
            float* d_input_;
            float* d_ground_truth_;
            inter_op::Int2 resolution_;
            cudaStream_t stream_;
    };

    class MetricsRADExecutor : public FunctionExecutor
    {
        public:
            using ReturnType = float;
            MetricsRADExecutor() = default;
            void execute(FunctionArgs* args) override;
            auto getResult() -> std::any override;
            void wait() override;

        private:
            std::tuple<thrust::cuda::unique_eager_future<float>,
                       thrust::cuda::unique_eager_future<float>>
                future_;
    };
} // namespace solar::cuda::async
